package com.zzyl.controller.customer;


import com.zzyl.base.ResponseResult;
import com.zzyl.dto.UserLoginRequestDto;
import com.zzyl.service.MemberService;
import com.zzyl.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/user")
@Api(tags = "微信登录相关接口")
public class CustomerUserController {

    @Autowired
    private MemberService memberService;

    /**
     * 微信小程序登录
     *
     * @param ulrd
     * @return
     */
    @PostMapping("/login")
    @ApiOperation("微信小程序登录")
    public ResponseResult<LoginVo> login(@RequestBody UserLoginRequestDto ulrd) {

        LoginVo loginVo = memberService.login(ulrd);

        return ResponseResult.success(loginVo);
    }
}
